#ifndef P_ADDITEM_H
#define P_ADDITEM_H

#include <head/g_pch.h>
#include <head/m_message.h>
#include "m_fhs.h"

namespace Ui {
class P_AddItem;
}

class P_AddItem : public QDialog
{
    Q_OBJECT

public:
    explicit P_AddItem(QWidget *parent,
                       const QStringList &topics);
    ~P_AddItem();

    void setTopic(const QString &topic);

    void setItem(int id,
                 const QString &topic,
                 const QString &label,
                 const QString &detail,
                 const QString &addition);

signals:
    void addItem(const QJsonObject &obj);
    void updateItem(const QJsonObject &obj);

private slots:
    void on_btn_submit_clicked();
    void on_topics_currentTextChanged(const QString &arg1);

private:
    Ui::P_AddItem *ui;

    int _id;
    QString _topic,_label;
    QString _detail,_addition;
};

#endif // P_ADDITEM_H
